import axios from '@/utils/request'
// 新增角色
export const addRoleApi = (data) => {
  return axios({
    method: 'post',
    url: '/sys/role',
    data
  })
}
// 获取角色列表
export const getRoleApi = (params) => {
  return axios({
    url: '/sys/role',
    params
  })
}
// 删除角色
export const delRoleApi = (id) => {
  return axios({
    method: 'delete',
    url: `/sys/role/${id}`
  })
}
// 修改角色
export const editRoleApi = (data) => {
  return axios({
    method: 'put',
    url: `/sys/role/${data.id}`,
    data
  })
}
